package com.gmgx.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component
//@Aspect
public class AopByAnnotation2 {

    // 第二种情况，每个通知注解上自己定义 切点表达式
    @Before("execution(* com.gmgx.service..IStudentService.*(..))")
    public void beforeMethod(){
        System.out.println("beforeMethod...");
    }

    @After("execution(* com.gmgx.service..IStudentService.*(..))")
    public void afterMethod(){
        System.out.println("afterMethod...");
    }


}
